<%@ page import="com.my.Customer" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="hao" uri="http://www.hao.com/mytag/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<hao:testTagFragment>Hello World</hao:testTagFragment>
<br><br>
<hao:printUpper time="10">tom</hao:printUpper>

<br><br>


<%
    List<Customer> customerList = new ArrayList<Customer>();
    customerList.add(new Customer(1, "AAA"));
    customerList.add(new Customer(2, "BBB"));
    customerList.add(new Customer(3, "CCC"));
    customerList.add(new Customer(4, "DDD"));
    customerList.add(new Customer(5, "EEE"));

    request.setAttribute("customerList", customerList);

    Map<String, Customer> customerMap = new HashMap<String, Customer>();
    customerMap.put("a", customerList.get(0));
    customerMap.put("b", customerList.get(1));
    customerMap.put("e", customerList.get(2));
    customerMap.put("f", customerList.get(3));
    customerMap.put("e", customerList.get(4));

    request.setAttribute("customerMap", customerMap);
%>

<hao:forEach items="${requestScope.customerList}" var="cust">
    ${cust.id}---${cust.name}<br/>
</hao:forEach>


<br/><br/>
<%-- 使用一个EL的自定义函数 --%>
${fn:length(param.name)}

<br/><br/>
<%-- 使用自定义EL函数 --%>
${hao:concat("我是", "你爸爸")}
</body>
</html>
